// api.ts

// 导入本地 JSON 文件
import mockData from '../../public/data/mockData.json';

// 延迟函数，模拟网络请求延迟
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));

function getMockData () {
    const fetchKnowledgeGraphData = async () => {
        try {
            // 添加延迟以模拟网络请求
            await delay(500);

            // 直接返回本地 JSON 数据
            return mockData;
        } catch (error) {
            console.error('Error loading mock data:', error);
            throw error;
        }
    };
    return fetchKnowledgeGraphData()
}

export default getMockData;
